  {extend name="public/base" /} 
  {block name="head"} 
  <meta charset="UTF-8" /> 
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport" /> 
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> 
    <link href="/resource/ui-framework/easyui-1.5.2/themes/metro/easyui-c5a176a3d4.css" rel="stylesheet" />
    <link href="/resource/ui-framework/easyui-1.5.2/themes/icon-77a4ded0c8.css" rel="stylesheet" />
    <link href="/resource/ui-framework/bootstrap/3.0.3/css/bootstrap-a067b6d831.min.css" rel="stylesheet" />
    <link href="/resource/ui-framework/bootstrap-daterangepicker/css/daterangepicker-886dba62c4.css" rel="stylesheet" />
    <link href="/resource/ui-framework/font-awesome/css/font-awesome-a81d284b37.css" rel="stylesheet" />
    <link href="/resource/ui-framework/admin-lte/css/AdminLET-7d58b99a7e.css" rel="stylesheet" />
    <link href="/static/css/base-dc47892812.css" rel="stylesheet" />
    <link href="/resource/ui-framework/jason/searchbox/css/searchbox-398327fb84.css" rel="stylesheet" />
    <link href="/resource/ui-framework/jason/pager/css/pager-f077f5e880.css" rel="stylesheet" />
    <link href="/resource/ui-framework/jason/status/css/status-5f59ab3856.css" rel="stylesheet" />
    <link href="/resource/ui-framework/jason/selector/css/selector-23060c280e.css" rel="stylesheet" />
    <link href="/resource/ui-framework/jason/button/css/button-5ef10c798a.css" rel="stylesheet" />
    <link href="/resource/ui-framework/jason/orderarrow/css/orderarrow-dcf8eba7d1.css" rel="stylesheet" />
    <link href="/static/css/table-0e491bc98f.css" rel="stylesheet" />
    <link href="/static/css/easyui-ext-372f902530.css" rel="stylesheet" />      
  {/block} 
    {block name="nav"}
        <section class="sidebar">
        <ul class="sidebar-menu" id="menu">
          <li class="treeview active">
              <a>
                  <i class="fa fa-home"></i><span>订单管理</span>
                  <i class="fa fa-angle-left pull-right"></i>
              </a>
              <ul class="treeview-menu">
                  <li><a href="/index/beater/index" {if('/index/beater/index' == strtolower($_SERVER['REQUEST_URI']))}class="url-selected"{/if}><i class="fa"></i>订单管里</a></li>
              </ul>
          </li>
          <li class="treeview active">
              <a>
                  <i class="fa fa-user"></i><span>团管理</span>
                  <i class="fa fa-angle-left pull-right"></i>
              </a>
              <ul class="treeview-menu">
                  <li><a href="/index/beater/mygroup" {if('/index/beater/mygroup' == strtolower($_SERVER['REQUEST_URI']))}class="url-selected"{/if}><i class="fa"></i>我的团</a></li>
              </ul>
          </li>
        </ul>
      </section>
  {/block}
  {block name="content"} 


  <section class="content"> 
   <div class="container" style="width:100%;"> 
    <div class="row"> 
     <div class="col-md-12 col-sm-12 col-xm-12">
      <div class="container" style="width: 100%;"> 
       <div class="row" style="margin-bottom: 10px;"> 
        <ul id="tabStatus" class="jason-status">
         <li data-options="all" <?php if(!isset($_GET['status']) || (isset($_GET['status']) && $_GET['status']=='all' ) ){ echo 'class="selected"'; } ?>>
          <div class="item">全部订单</div>
         </li>
        </ul> 
       </div> 
       <div class="row"> 
        <div class="fl" style="width: 100%"> 
         <ul> 
          <li class="fl" style="height: 30px"><input style="height: 30px" type="text" class="form-control" id="dateRange" name="date" style="width:280px;" value="<?php if(isset($_GET['date'])){ echo $_GET['date']; } ?>" /> </li>
          <li class="fl" style="margin-left: 5px;height: 30px"><input style="height: 30px" type="text" name="area" placeholder="区：" value="<?php if(isset($_GET['area'])){ echo $_GET['area']; } ?>" class="form-control" /> </li>
          <li class="fl" style="margin-left: 5px;height: 30px"><input style="height: 30px" type="text" name="server" placeholder="服：" value="<?php if(isset($_GET['server'])){ echo $_GET['server']; } ?>" class="form-control" /> </li>
          <li class="fl" style="margin-left: 5px;height: 30px"><input style="height: 30px" type="text" name="type"  placeholder="类型：" value="<?php if(isset($_GET['type'])){ echo $_GET['type']; } ?>" class="form-control" /> </li>
          <li class="fl ml10"> 
           <div id="statuses"></div> </li> 
          <li class="fl ml10"> 
           <div id="searchInput">
            <div class="searchTxt" style="height: 30px">
             <div class="searchMenu">
             <?php $search_type = 0; if(isset($_GET['search_type'])){ $search_type = $_GET['search_type']; } ?>
              <select style="margin-left: 5px;height: 26px" name="search_type">
                <option value="1" {if condition="$search_type eq 1"}selected{/if} >角色名</option>
                <option value="2" {if condition="$search_type eq 2"}selected{/if} >手机号</option>
                <option value="3" {if condition="$search_type eq 3"}selected{/if} >旺旺号</option>
                <option value="4" {if condition="$search_type eq 4"}selected{/if} >帐号</option>
                <option value="5" {if condition="$search_type eq 5"}selected{/if} >客服</option>
                <option value="6" {if condition="$search_type eq 6"}selected{/if} >订单编号</option>
                <option value="7" {if condition="$search_type eq 7"}selected{/if} >代练项目</option>
                <option value="8" {if condition="$search_type eq 8"}selected{/if} >代练员</option>
              </select>
             </div>
             <input style="height: 28px" name="keyword" type="text" value="<?php if(isset($_GET['keyword'])){ echo $_GET['keyword']; } ?>"/>
            </div>
            <div class="searchBtn" onclick="searchBtn()" style="height: 30px;line-height: 30px">
             查询
            </div>
            <div class="resetBtn" onclick="resetBtn()" style="height: 30px;line-height: 30px">
             清空
            </div>
           </div> </li> 
         </ul> 
        </div> 
       </div> 
      </div> 
      <table class="order mt10" style="float: left; margin-bottom: 5px;"> 
       <thead> 
        <tr class="header"> 
         <!-- <td> <input type="checkbox" id="ck_selectAll_A" /></td>  -->
         <td>游戏区服</td> 
         <td>类型</td> 
         <td style="width:200px;">代练项目</td> 
         <td>账号</td> 
         <td id="orderTarget1" style="cursor: pointer;"> 
          <div id="lblLeftTime">
           剩余时间
          </div> </td> 
         <td> 
          <div class="ml" id="orderByLeftTime">
           <div class="topArrow"></div>
           <div class="bottomArrow mt3"></div>
          </div> </td> 
         <td>状态</td> 
         <td>密码</td> 
         <td>角色名</td> 
         <td>订单编号</td> 
         <td>接价</td> 
         <td>客服</td> 
         <td>备注</td> 
         <td> 
          <div id="lblTime">
           下单时间
          </div> </td> 
         <td>操作</td> 
        </tr> 
       </thead>
       <tbody id="orders"> 
        {if condition="$count== 0"}
        <tr class="project">
            <td colspan="16">
                <span style="width: 200px; margin: 10px auto;">没有符合条件的订单</span>
            </td>
        </tr>
        {else /}
        {volist name="data" id="vo"}
        <tr class="project indblclick" value="{$vo.id}">
           <!--  <td>
                <input type="checkbox" class="ck_select" />
            </td> -->
            <td style="text-align: left;">魔兽世界{$vo.area}{$vo.server}</td>
            <td>{$vo.type}</td>
            <td style="text-align: left;">{$vo.content}</td>
            <td>
                <div class="digit_item">
                    {$vo.login}
                </div>
            </td>
            <td colspan="2">
                {if condition="($vo.ordertime > 0) AND ($vo.time>0)"}
                    <span style="color: red">{:nicetime($vo.ordertime,$vo.create_time)}</span>
                {else /}
                    <span>{:nicetime($vo.ordertime,$vo.create_time)}</span>
                {/if}
            </td>
            {if condition="$vo.status == -1"}
                <td class="ex">已删除</td>
            {elseif condition="$vo.status == 0"}                
                    <td class="undispatched">未分配</td>
            {elseif condition="$vo.status == 11"}          
                    <td class="dispatched">未接手</td>
            {elseif condition="$vo.status == 1"}          
                    <td class="dispatched">代练中</td>
            {elseif condition="$vo.status == 2"}      
                    <td class="done">待验收</td>
            {elseif condition="$vo.status == 3"}    
                    <td class="settled">已完成</td>
            {elseif condition="$vo.status == 4"}
                    <td class="locked">已结算</td>
            {elseif condition="$vo.status == 5"}
                    <td class="exception">已仲裁</td>
            {elseif condition="$vo.status == 6"}
                    <td class="arbitrating">已撤销</td>
            {elseif condition="$vo.status == 7"}
                    <td class="repealing">已退款</td>
            {elseif condition="$vo.status == 8"}
                    <td class="repealing">已锁定</td>
            {elseif condition="$vo.status == 9"}
                    <td class="repealing">异常中</td>
            {elseif condition="$vo.status == 10"}
                    <td class="repealing">仲裁中</td>                       
            {/if}
            <td>
                <a href="javascript:void(0)">{$vo.password}</a>
            </td>
            <td>
                <a href="javascript:void(0)">{$vo.role}</a>
            </td>              
            <td style="text-align: left">
                [{:getFirstChar($vo.order)}]
                <span style="color: red; display: none;">[多]</span>
                <span style="color: red; display: none;">[撤]</span>
                <span style="color: red; display: none;">[仲]</span>
                {if condition="$vo.is_urgent"}
                    <span style="color: red">[急]</span>
                {/if}
                 <a class="easyui-tooltip" title="">{$vo.number}</a>
                 {if condition="$vo.tags_id"}
                 <?php $row_tags = getTags($vo['tags_id']);  ?>
                    <span class="tag" style="background-color: {$row_tags.color};margin-bottom: 4px;">{$row_tags.title}</span>
                {/if}
            </td>
            <td>
                <div class="digit_item">￥{$vo.orderpeice}</div>
            </td>
            <td>{$vo.servername}</td>
            <td>                
                 <a class="easyui-tooltip" title="" style="float: left">{:cut_str($vo.remark,10)}</a>

            </td>
            <td>{if condition="$vo.status == 4"}
                    <span>{:date("Y-m-d H:i",$vo.do_time)}</span>
                {elseif condition="$vo.status == 5"}
                    <span>{:date("Y-m-d H:i",$vo.end_time)}</span>
                {elseif condition="$vo.status == 10"}
                    <span>{:date("Y-m-d H:i",$vo.end_time)}</span>
                {else}
                    <span>{:date("Y-m-d H:i",$vo.create_time)}</span>
                {/if}
            </td>
            <td>
                {if($vo.status eq 11)}
                <a href="javascript:void(0)" onclick="getOrder({$vo.id})" style="margin-left: 10px;">接收</a>
                {/if}
                {if($vo.status eq 1)}
                <a href="javascript:void(0)" onclick="overOrder({$vo.id})" style="margin-left: 10px;">完成</a>
                {/if}
                <div class="hide-orther" style="margin-left: 160px; width: 100px;display: none;position:absolute;background-color:#fff;z-index:999;">
                    <div>
                        <a href="javascript:" onclick="del({$vo.id})">删除</a>
                    </div>
                    <div>
                        <a href="javascript:" onclick="edit({$vo.id})">修改</a>
                    </div>
                    <div>
                        <a href="javascript:" onclick="urgent({$vo.id},{$vo.is_urgent})">{if condition="$vo.is_urgent == 1"}取消加急{else /}加急{/if}</a>
                    </div>
                    {if condition="$vo.status neq 7 "}
                    <div>
                        <a href="javascript:" onclick="callback({$vo.id})">退款</a>
                    </div>
                    {/if}
                    <div class="menu-sep"></div>
                    <div>
                        <a href="javascript:" onclick="">短信</a>
                    </div>
                    <div class="menu-sep"></div>
                    <div>
                        <a href="javascript:">txt文本</a>
                    </div>
                </div>

            </td>
        </tr>
        {/volist}
        {/if}
       </tbody> 
       <tfoot > 
        <tr class="footer"> 
         <td></td> 
         <td colspan="15"> 
          <div id="pager" class="fr page_ctrl" style="margin-top: 6px;">
            {$data->render()}
          </div> </td> 
        </tr>
       </tfoot> 
      </table>
     </div> 
    </div> 
   </div> 
  </section> {/block} {block name="script"} 
<script src="/resource/libs/jquery/jquery.js"></script>
<script src="/resource/ui-framework/admin-lte/app-bf15eda982.js"></script> 
<script src="/resource/libs/ajaxfileupload.js"></script>
<script src="/resource/ui-framework/bootstrap/3.0.3/js/bootstrap.min.js"></script>  
<script src="/resource/ui-framework/bootstrap-daterangepicker/js/moment.js"></script>
<script src="/resource/ui-framework/bootstrap-daterangepicker/js/daterangepicker.js"></script>
<script src="/resource/ui-framework/admin-lte/app.js"></script>
<script src="/resource/ui-framework/easyui-1.5.2/jquery.easyui.min.js"></script>
<script src="/resource/ui-framework/easyui/plugins/jquery.checkbox.js"></script>        
<script src="/resource/ui-framework/jason/searchbox/searchbox.js"></script>
<script src="/resource/ui-framework/jason/pager/pager.js"></script>
<script src="/resource/ui-framework/jason/status/sky.tools.status.js"></script>
<script src="/resource/ui-framework/jason/screenshot-paste.js"></script>
<script src="/resource/ui-framework/jason/selector/selector.js"></script>
<script src="/resource/ui-framework/jason/button/button.js"></script>
<script src="/resource/ui-framework/jason/orderarrow/orderarrow.js"></script>
<script src="/resource/libs/clipboard.min.js"></script>
<script src="/resource/libs/template.js"></script>
<script src="/resource/libs/jquery.cookie.js"></script>
<script src="/resource/libs/common.js"></script>
<script src="/resource/libs/tools.js"></script>        
<script src="/resource/libs/basePage.js"></script>
<script src="/static/js/layer/layer.js"></script>
<script type="text/javascript">
    $().ready(function () {
        var url = $('#hdnURL').val();
        $('.sidebar .treeview').each(function (index, item) {
            var btn = $(this).children("a").first();
            var menu = $(this).children(".treeview-menu").first();

            $(this).find('a').each(function (index, item) {
                if ($(item).attr('href') == url) {
                    menu.show();
                    btn.children(".fa-angle-left").first().removeClass("fa-angle-left").addClass("fa-angle-down");
                }
            });
        });
    });
status = "<?php if(isset($_GET['status']) && $_GET['status'] ){ echo $_GET['status']; }else{ echo 'all'; } ?>";
var today = '<?php echo date("Y/m/d"); ?>,<?php echo date("Y/m/d",time()+24*3600); ?>';
var yesterday = '<?php echo date("Y/m/d",time()-24*3600); ?>,<?php echo date("Y/m/d"); ?>';
var sevenday = '<?php echo date("Y/m/d",time()-7*24*3600); ?>,<?php echo date("Y/m/d"); ?>';
var thirtyday = '<?php echo date("Y/m/d",time()-30*24*3600); ?>,<?php echo date("Y/m/d"); ?>';
var rangeCurrentMonth = '<?php echo date("Y/m/01"); ?>,<?php echo date("Y/m/d"); ?>';
$("#dateRange").daterangepicker(
    {
    showDropdowns:!0,
    timePicker:!0,
    timePicker24Hour:!0,
    timePickerIncrement:5,
    autoApply:!0,
    startDate:$("#startDate").val(),
    endDate:$("#endDate").val(),
    ranges:
    {
    "今天":today.split(","),
    "昨天":yesterday.split(","),
    "最近7天":sevenday.split(","),
    "最近30天":thirtyday.split(","),
    "本月":rangeCurrentMonth.split(",")
    },
    locale:
    {
    direction:"ltr",
    format:"YYYY/MM/DD HH:mm",
    separator:" - ",
    applyLabel:"确定",
    cancelLabel:"取消",
    fromLabel:"From",
    toLabel:"To",
    customRangeLabel:"自定义",
    daysOfWeek:["日","一","二","三","四","五","六"],
    monthNames:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],
    firstDay:1
    },
    linkedCalendars:!1,
    alwaysShowCalendars:!1,
    opens:"right"
    },function(e,t,i){
        
    });

function getOrder(id){
   $.post('/index/beater/getOrder',{id:id},function(res){
      layer.msg(res.msg);
      if(res.code == 1){
          window.setTimeout(function(){
              window.location.reload();
          },1000);
      }    
  })
}


function overOrder(id){
layer.confirm('此操作不可撤销，确定要完成该订单？', {}, function(){
    $.post('/index/beater/overOrder',{id:id},function(res){
        layer.msg(res.msg);
        if(res.code == 1){
            window.setTimeout(function(){
                window.location.reload();
            },1000);
        }
    })
}, function(){
});
}




$("#tabStatus li").click(function(res){
    $("#tabStatus li").removeClass("selected");
    $(this).addClass("selected");
    status = $(this).attr("data-options");
    window.location.href = '/index/index/index?status='+status;
});
function searchBtn(){
  search(status)
}
function search(status){
    var date = $("input[name=date]").val();
    var area = $("input[name=area]").val();
    var server = $("input[name=server]").val();
    var type = $("input[name=type]").val();
    var search_type = $("select[name=search_type]").val();
    var keyword = $("input[name=keyword]").val();
    window.location.href = '/index/beater/index?status='+status+'&date='+date+'&area='+area+'&server='+server+'&type='+type+'&search_type='+search_type+'&keyword='+keyword;

}
function resetBtn(){

    $("input[name=area]").val('');
    $("input[name=server]").val('');
    $("input[name=type]").val('');
    $("select[name=search_type]").val('1');
    $("input[name=keyword]").val('');
}
</script> 
{/block}
 </body>
</html>